package springstudy.util;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringUtil {
	public static ApplicationContext ctx;
	
	static{
		ctx = new ClassPathXmlApplicationContext("bean.xml");
	}
	
	public static ApplicationContext getApplicationContext(){
		if(ctx == null)
			ctx =  getApplicationContext("bean.xml");
		return ctx;
	}
	
	public static ApplicationContext getApplicationContext(String path){
			return new ClassPathXmlApplicationContext(path);
	}
}	
